<div id="baseInfo" class="site-text site-block" style="padding-top: 20px">
    <form id="baseInfo-form" class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 100px">帐户</label>
            <div class="layui-input-inline" style="width: 300px">
                <input type="text" name="username" class="layui-input cms-single-line" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 100px">姓名</label>
            <div class="layui-input-inline" style="width: 300px">
                <input type="text" name="name" class="layui-input cms-single-line">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 100px">角色</label>
            <div class="layui-input-inline" style="width: 300px">
                <input type="text" name="roleName" class="layui-input cms-single-line" readonly>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 100px">联系方式</label>
            <div class="layui-input-inline" style="width: 300px">
                <input type="text" name="phone" class="layui-input cms-single-line">
            </div>
        </div>
        <div align="center" style="padding-top: 10px">
            <button type="button" class="layui-btn layui-btn-primary cms-btn-width"
                    lay-submit lay-filter="baseInfo-btn-update" onclick="update()">修改</button>
        </div>
    </form>
    <script type="text/javascript">

        // 添加
        layui.form.on('submit(baseInfo-btn-update)', function (data) {
            layer.confirm('确定修改吗？', {
                btn:['确定', '取消']
            }, function (index) {
                $.ajax({
                    type: 'post',
                    url: '/cms/updateUserInfo',
                    data: data.field,
                    dataType: 'json',
                    success: function (data) {
                        if (data.code == 200) {
                            layer.msg(data.msg ? data.msg : '保存成功', {anim: 6});
                        } else {
                            layer.msg(data.msg ? data.msg : '保存失败', {anim: 6});
                        }
                    }
                });
            });
        });
    </script>
</div>